from MSTH.configs.method_import import *

method_configs: Dict[str, Union[TrainerConfig, VideoTrainerConfig]] = {}

method_configs["tp2"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=1.0,
            ),
            train_num_rays_per_batch=20000,
            eval_num_rays_per_batch=20000,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=False,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=1,
            static_ratio_decay_total_steps=6000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.01,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp3"] = deepcopy(method_configs["tp2"])
method_configs["tp3"].pipeline.model.mask_loss_mult = 0.1

method_configs["tp4"] = deepcopy(method_configs["tp2"])
method_configs["tp4"].pipeline.model.mask_loss_mult = 0.001

method_configs["tp5"] = deepcopy(method_configs["tp3"])
method_configs["tp5"].pipeline.model.mask_reso = (512, 512, 512)
method_configs["tp5"].pipeline.model.mask_log2_hash_size = 27
method_configs["tp5"].pipeline.model.proposal_net_args_list[0]["mask_reso"] = (512, 512, 512)
method_configs["tp5"].pipeline.model.proposal_net_args_list[0]["mask_log2_hash_size"] = 27
method_configs["tp5"].pipeline.model.proposal_net_args_list[1]["mask_reso"] = (512, 512, 512)
method_configs["tp5"].pipeline.model.proposal_net_args_list[1]["mask_log2_hash_size"] = 27

# Exp conclusion: large hash will preserve more details.
method_configs["tp7_large_thash_23"] = deepcopy(method_configs["tp2"])
method_configs["tp7_large_thash_23"].pipeline.model.log2_hashmap_size_temporal = 23
method_configs["tp7_large_thash_23"].pipeline.model.proposal_net_args_list[0]["log2_hashmap_size_temporal"] = 23
method_configs["tp7_large_thash_23"].pipeline.model.proposal_net_args_list[1]["log2_hashmap_size_temporal"] = 23

method_configs["tp8_small_thash_18"] = deepcopy(method_configs["tp2"])
method_configs["tp8_small_thash_18"].pipeline.model.log2_hashmap_size_temporal = 18
method_configs["tp8_small_thash_18"].pipeline.model.proposal_net_args_list[0]["log2_hashmap_size_temporal"] = 18
method_configs["tp8_small_thash_18"].pipeline.model.proposal_net_args_list[1]["log2_hashmap_size_temporal"] = 18

method_configs["tp6"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                scale_factor=1.0 / 4.0,
            ),
            train_num_rays_per_batch=20000,
            eval_num_rays_per_batch=20000,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=False,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=1,
            static_ratio_decay_total_steps=6000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.01,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp9_sampler_50_10"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=4096,
            eval_num_rays_per_batch=4096,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp10_hierarchicay"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=4096,
            eval_num_rays_per_batch=4096,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mst",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            mask_type="hierarchical",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mst",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mst",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)


method_configs["tp11_hierarchicay"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=4096,
            eval_num_rays_per_batch=4096,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            mask_type="hierarchical",
            use_loss_static=True,
            render_static=True,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp12_hierarchicay_mt_30000"] = deepcopy(method_configs["tp11_hierarchicay"])
method_configs["tp12_hierarchicay_mt_30000"].max_num_iterations = 30000
method_configs["tp12_hierarchicay_mt_30000"].optimizers["proposal_networks"]["scheduler"].max_steps = 30000
method_configs["tp12_hierarchicay_mt_30000"].optimizers["fields"]["scheduler"].max_steps = 30000

# not good as tp11
method_configs["tp13_hierarchicay_mt_base6"] = deepcopy(method_configs["tp11_hierarchicay"])
method_configs["tp13_hierarchicay_mt_base6"].pipeline.model.base_res = (16, 16, 16, 6)
method_configs["tp13_hierarchicay_mt_base6"].pipeline.model.proposal_net_args_list[0]["base_res"] = (16, 16, 16, 6)
method_configs["tp13_hierarchicay_mt_base6"].pipeline.model.proposal_net_args_list[1]["base_res"] = (16, 16, 16, 6)

# not good as tp11
method_configs["tp14_hierarchicay_mt_base30"] = deepcopy(method_configs["tp11_hierarchicay"])
method_configs["tp14_hierarchicay_mt_base30"].pipeline.model.base_res = (16, 16, 16, 30)
method_configs["tp14_hierarchicay_mt_base30"].pipeline.model.proposal_net_args_list[0]["base_res"] = (16, 16, 16, 30)
method_configs["tp14_hierarchicay_mt_base30"].pipeline.model.proposal_net_args_list[1]["base_res"] = (16, 16, 16, 30)

# 3e-2 will learn nothing for dynamic part
method_configs["tp15_lr1"] = deepcopy(method_configs["tp11_hierarchicay"])
method_configs["tp15_lr1"].optimizers["proposal_networks"]["optimizer"].lr = 3e-2
method_configs["tp15_lr1"].optimizers["fields"]["optimizer"].lr = 3e-2


method_configs["tp16_lr2"] = deepcopy(method_configs["tp11_hierarchicay"])
method_configs["tp16_lr2"].optimizers["proposal_networks"]["optimizer"].lr = 7e-3
method_configs["tp16_lr2"].optimizers["fields"]["optimizer"].lr = 7e-3

method_configs["tp17_lr3"] = deepcopy(method_configs["tp11_hierarchicay"])
method_configs["tp17_lr3"].optimizers["proposal_networks"]["optimizer"].lr = 1.5e-2
method_configs["tp17_lr3"].optimizers["fields"]["optimizer"].lr = 1.5e-2

method_configs["tp18_lr4"] = deepcopy(method_configs["tp11_hierarchicay"])
method_configs["tp18_lr4"].optimizers["proposal_networks"]["optimizer"].lr = 2e-2
method_configs["tp18_lr4"].optimizers["fields"]["optimizer"].lr = 2e-2


method_configs["tp19_hierarchicay"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=4096,
            eval_num_rays_per_batch=4096,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp20_hierarchicay_nostatic"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=4096,
            eval_num_rays_per_batch=4096,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            mask_type="hierarchical",
            use_loss_static=False,
            render_static=False,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp21_nodistortion"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=4096,
            eval_num_rays_per_batch=4096,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            mask_type="hierarchical",
            use_loss_static=True,
            render_static=True,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp22_hierarchicay_0.25scale"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.25,
            ),
            train_num_rays_per_batch=4096,
            eval_num_rays_per_batch=4096,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            mask_type="hierarchical",
            use_loss_static=True,
            render_static=True,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp24_hierarchicay_50"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    steps_full_video=9999,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=4096,
            eval_num_rays_per_batch=4096,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=50,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            mask_type="hierarchical",
            use_loss_static=True,
            render_static=True,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp25_shared_mlp"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=4096,
            eval_num_rays_per_batch=4096,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            mask_type="hierarchical",
            use_loss_static=True,
            render_static=True,
            st_mlp_mode="shared",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                    "st_mlp_mode": "shared",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                    "st_mlp_mode": "shared",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp26_hierarchicay_8192"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=8192,
            eval_num_rays_per_batch=8192,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            mask_type="hierarchical",
            use_loss_static=True,
            render_static=True,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp27_hierarchicay_16384"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            eval_num_rays_per_batch=16384,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            eval_num_rays_per_chunk=32768,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            mask_type="hierarchical",
            use_loss_static=True,
            render_static=True,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp28_hierarchicay_32768"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=32768,
            eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            mask_type="hierarchical",
            use_loss_static=True,
            render_static=True,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp29_hierarchicay_16384_nostatic"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            eval_num_rays_per_batch=16384,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(256, 256, 256),
            mask_log2_hash_size=24,
            mask_type="hierarchical",
            use_loss_static=False,
            render_static=False,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (256, 256, 256),
                    "mask_log2_hash_size": 24,
                    "mask_type": "hierarchical",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp30_shared_mlp"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            eval_num_rays_per_batch=16384,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            use_loss_static=True,
            render_static=True,
            st_mlp_mode="shared",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "hierarchical",
                    "st_mlp_mode": "shared",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "hierarchical",
                    "st_mlp_mode": "shared",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)


method_configs["tp31_hierarchicay_16384_small_mask"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "hierarchical",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp32_hierarchicay_16384_mask_loss_and_longer"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=30000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            # mask_loss_mult=0.01,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "hierarchical",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=1e-4, max_steps=30000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=1e-4, max_steps=30000),
        },
    },
)

method_configs["tp33_31_p_sample_network"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=4096,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            # use sample network for accelerating rendering
            use_sample_network=True,
            sample_network_hidden_dim=64,
            sample_network_num_layers=2,
            sample_network_loss_mult=1,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "hierarchical",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)


method_configs["tp34_hierarchicay_16384_small_mask"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=64,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "hierarchical",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)


method_configs["tp35_hierarchicay_16384_small_mask"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=65536,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp36_35_plus_linear"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": True,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp37_35_plus_alllinear"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            use_linear_for_collision=True,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": True,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp38_small_hash_base36"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=17,
            log2_hashmap_size_temporal=17,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(32, 32, 32),
            mask_log2_hash_size=15,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 21,
                    "log2_hashmap_size_temporal": 25,
                    "num_levels": 1,
                    "features_per_level": 1,
                    "max_res": (128, 128, 128, 16),
                    "base_res": (128, 128, 128, 16),
                    # "base_res": (16, 16, 16, 15),
                    "use_linear": True,
                    "mode": "mt",
                    "mask_reso": (32, 32, 32),
                    "mask_log2_hash_size": 15,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                    "spatial_only": True,
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)


method_configs["tp39_35_p_allnearset"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=65536,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="all_nearest",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                    "interp": "all_nearest",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp40_same_as_35"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=65536,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="linear",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                    "interp": "linear",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)


method_configs["tp41_40_last_nearest_for_ps"] = copy.deepcopy(method_configs["tp40_same_as_35"])
method_configs["tp41_40_last_nearest_for_ps"].pipeline.model.proposal_net_args_list[0]["interp"] = "last_nearest"

method_configs["tp42_40_all_nearest_for_ps"] = copy.deepcopy(method_configs["tp40_same_as_35"])
method_configs["tp42_40_all_nearest_for_ps"].pipeline.model.proposal_net_args_list[0]["interp"] = "all_nearest"

method_configs["tp43_40_64"] = copy.deepcopy(method_configs["tp40_same_as_35"])
method_configs["tp43_40_64"].pipeline.model.num_proposal_samples_per_ray = (64,)

method_configs["tp44_40_global_64"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(64,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=65536,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="linear",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                    "interp": "linear",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp45_44_p_shared"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(64,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=65536,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            st_mlp_mode="shared",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="linear",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                    "interp": "linear",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp46_45_p_50_0.1"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=0.1,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(64,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=65536,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            # st_mlp_mode="",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="linear",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                    "interp": "linear",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp47_46_p_20"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=0.1,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(64,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=20,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=65536,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            # st_mlp_mode="shared",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="linear",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                    "interp": "linear",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp48"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=0.1,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=20,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=65536,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="linear",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    # "st_mlp_mode": "shared",
                    "interp": "linear",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp49_hierarchicay_16384_small_mask_base34"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=0.1,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=64,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "hierarchical",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp50_hierarchicay_16384_small_mask_base34_level_one_interp"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=0.1,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=64,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            level_one_interp="last_nearest",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "hierarchical",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp51_34_p_global"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp52_34_p_global_p_shared"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            st_mlp_mode="shared",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp53_52_p_fuse"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_eval_image=500,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global_fuse",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            st_mlp_mode="shared",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global_fuse",
                    "st_mlp_mode": "shared",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tp54_same_as_35_no_sigmoid"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=65536,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="hierarchical",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="linear",
            nosigmoid=True,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                    "interp": "linear",
                    "nosigmoid": True,
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)


method_configs["tp52_34_p_global_p_shared"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            # far_plane=500,
            # proposal_initial_sampler="uniform",
            # sparse_loss_mult_h=0.01,
            # sparse_loss_mult_f=0.01,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            st_mlp_mode="shared",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)


method_configs["tpa_1"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                # data=Path("/data/machine/data/flame_salmon_videos_2"),
                data=Path("/data/machine/data/fit/videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="linear",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                    "interp": "linear",
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tpa_2"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                # data=Path("/data/machine/data/flame_salmon_videos_2"),
                data=Path("/data/machine/data/fit/videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="linear",
            ablation_add=True,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "independent",
                    "interp": "linear",
                    "ablation_add": True,
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tpa_1_20"] = copy.deepcopy(method_configs["tpa_1"])
method_configs["tpa_1_20"].pipeline.model.log2_hashmap_size_temporal = 20
method_configs["tpa_2_20"] = copy.deepcopy(method_configs["tpa_2"])
method_configs["tpa_2_20"].pipeline.model.log2_hashmap_size_temporal = 20

method_configs["tpa_1_smp"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                # data=Path("/data/machine/data/flame_salmon_videos_2"),
                data=Path("/data/machine/data/fit/videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            # num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="linear",
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                    "interp": "linear",
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                    "interp": "linear",
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)

method_configs["tpa_2_smp"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                # data=Path("/data/machine/data/flame_salmon_videos_2"),
                data=Path("/data/machine/data/fit/videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            num_proposal_samples_per_ray=(256, 96),
            # num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=19,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mt",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="linear",
            ablation_add=True,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "independent",
                    "interp": "linear",
                    "ablation_add": True,
                },
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (256, 256, 256, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mt",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "hierarchical",
                    "mask_type": "global",
                    "st_mlp_mode": "independent",
                    "interp": "linear",
                    "ablation_add": True,
                },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)


method_configs["tpa_3"] = SpaceTimeHashingTrainerConfig(
    method_name="Spatial_Time_Hashing_With_Base",
    steps_per_eval_batch=1000,
    steps_per_save=20000,
    max_num_iterations=10000,
    mixed_precision=True,
    log_gradients=True,
    pipeline=SpaceTimePipelineConfig(
        datamanager=SpaceTimeDataManagerConfig(
            dataparser=VideoDataParserConfig(
                data=Path("/data/machine/data/flame_salmon_videos_2"),
                downscale_factor=2,
                # scale_factor=1.0 / 2.0,
                scale_factor=0.5,
            ),
            train_num_rays_per_batch=16384,
            # eval_num_rays_per_batch=32768,
            camera_optimizer=CameraOptimizerConfig(mode="off"),
            use_uint8=True,
            use_stratified_pixel_sampler=True,
            static_dynamic_sampling_ratio=50,
            static_dynamic_sampling_ratio_end=10,
            static_ratio_decay_total_steps=10000,
        ),
        model=DSpaceTimeHashingModelConfig(
            # distortion_loss_mult=0.0,
            max_res=(2048, 2048, 2048, 300),
            base_res=(16, 16, 16, 15),
            # num_proposal_samples_per_ray=(256, 96),
            num_proposal_samples_per_ray=(128,),
            num_nerf_samples_per_ray=48,
            proposal_weights_anneal_max_num_iters=5000,
            # proposal_weights_anneal_slope = 10.0,
            log2_hashmap_size_spatial=19,
            log2_hashmap_size_temporal=16,
            eval_num_rays_per_chunk=32768,
            mask_loss_mult=0.0,
            mst_mode="mst",
            mask_reso=(128, 128, 128),
            mask_log2_hash_size=21,
            mask_type="global",
            num_proposal_iterations=1,
            use_loss_static=False,
            render_static=False,
            interp="linear",
            nosigmoid=False,
            proposal_net_args_list=[
                {
                    "hidden_dim": 16,
                    "log2_hashmap_size_spatial": 17,
                    "log2_hashmap_size_temporal": 17,
                    "num_levels": 5,
                    "max_res": (128, 128, 128, 150),
                    "base_res": (16, 16, 16, 15),
                    "use_linear": False,
                    "mode": "mst",
                    "mask_reso": (64, 64, 64),
                    "mask_log2_hash_size": 18,
                    "mask_type": "global",
                    "st_mlp_mode": "shared",
                    "interp": "linear",
                    "nosigmoid": False,
                },
                # {
                #     "hidden_dim": 16,
                #     "log2_hashmap_size_spatial": 17,
                #     "log2_hashmap_size_temporal": 17,
                #     "num_levels": 5,
                #     "max_res": (256, 256, 256, 150),
                #     "base_res": (16, 16, 16, 15),
                #     "use_linear": False,
                #     "mode": "mt",
                #     "mask_reso": (64, 64, 64),
                #     "mask_log2_hash_size": 18,
                #     "mask_type": "hierarchical",
                # },
            ],
        ),
    ),
    optimizers={
        "proposal_networks": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
        "fields": {
            "optimizer": AdamOptimizerConfig(lr=1e-2, eps=1e-15),
            "scheduler": ExponentialDecaySchedulerConfig(lr_final=5e-4, max_steps=15000),
        },
    },
)
